import 'package:flutter/material.dart';

class IndicatorCard extends StatelessWidget {
  final Color? indicatorColor;
  final double indicatorWidth;
  final double borderRadius;
  final Color backgroundColor;
  final EdgeInsets padding;
  final Widget? child;

  const IndicatorCard({
    Key? key,
    this.child,
    this.indicatorColor,
    this.indicatorWidth = 4.0,
    this.borderRadius = 4.0,
    this.backgroundColor = Colors.white,
    this.padding = const EdgeInsets.all(8.0),
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Card(
      color: indicatorColor ?? Theme.of(context).primaryColor,
      margin: EdgeInsets.zero,
      clipBehavior: Clip.antiAlias,
      shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(borderRadius)),
      child: Container(
        margin: EdgeInsets.only(left: indicatorWidth),
        color: backgroundColor,
        child: Padding(
          padding: padding,
          child: child,
        ),
      ),
    );
  }
}
